//
//  AppDelegate.m
//  QTLifeCircle
//
//  Created by 徐腾 on 2017/1/15.
//  Copyright © 2017年 徐腾. All rights reserved.
//

#import "AppDelegate.h"

//短信验证
#import <SMS_SDK/SMSSDK.h>

#import "ViewController.h"
#import <Masonry.h>
@interface AppDelegate ()

@end

@implementation AppDelegate


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    
    //初始化应用，appKey和appSecret从后台申请得
    [SMSSDK registerApp:@"1ae0abd2d22a2"
             withSecret:@"b019ab87eca6b22e8e2c5fcd9c91a5ff"];
    
    //创建window
    self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
    
    //[[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"top"] forBarMetrics:UIBarMetricsDefault];

    //加载rootViewController
    [self firstLoad];
    
    return YES;
}


- (void)firstLoad {
    //记录当前版本
    static CGFloat currentDevice;
    currentDevice = [[UIDevice currentDevice].systemVersion floatValue] ;
    //    NSLog(@"%f",currentDevice);
    //判断版本
   // if (currentDevice == [[UIDevice currentDevice].systemVersion floatValue]) {
    UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
        ViewController *tabbarVC = [storyboard instantiateInitialViewController];
        self.window.rootViewController = tabbarVC;
   // }

    //让window可见
    [self.window makeKeyAndVisible];
}





- (void)applicationWillResignActive:(UIApplication *)application {
    // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
    // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}


- (void)applicationDidEnterBackground:(UIApplication *)application {
    // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
    // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}


- (void)applicationWillEnterForeground:(UIApplication *)application {
    // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}


- (void)applicationDidBecomeActive:(UIApplication *)application {
    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}


- (void)applicationWillTerminate:(UIApplication *)application {
    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}


@end
